'use strict';
var wx_collection = db.collection("wx_service");
// 定义类
class WXService {
    // 构造函数
    constructor(obj) {
        this.name = obj.name;
        this.TOKEN = obj.TOKEN;
        this.EncodingAESKey = obj.EncodingAESKey;
        this.KEY = obj.KEY;
        this.APPID = obj.APPID;
        this.APPSECRET = obj.APPSECRET;
        this.MCHID = obj.MCHID;
    };
    // 私有方法，只有被实例化才能实现
    save() {
        return mongo.insertOne(wx_collection, this);
    };
    get self() {
        return mongo.find(wx_collection);
    };
    // 静态方法，实例化后不可调用
    static speak() {
        var ss = new this({ name: 123 })
        console.log("hehehe")
    };
    static getAll(option) {
        co(function* () {
            var arr = yield mongo.find(wx_collection);
            option ? option.constructor == Function ? option(arr) : false : false;
        }).catch(e => { console.log(e) });
    };
};
module.exports = WXService;
var obj = {
    name: "dotnar",
    TOKEN: "jtldp8q40cfskyb9eptt4qe8kl8oajor",
    EncodingAESKey: "8zqy8lu2jYWgvK95H4nxdyX5DEZCcGy4HD8vD2rHhxN",
    KEY: "HXCU71nGNU5O4hvQlGSXEuMEMTWQs0HW",
    APPID: "wxcf74f930098faee1",
    APPSECRET: "77ff4d4b3f861ebacfe1de20c497c411",
    MCHID: "1233472902",
};
